Patterns as first class citizens

نویسندگان

  • Barry Jay
  • Delia Kesner
چکیده

The pure pattern calculus generalises the pure lambda-calculus by basing computation on pattern-matching instead of beta-reduction. The simplicity and power of the calculus derive from allowing any term to be a pattern. As well as supporting a uniform approach to functions, it supports a uniform approach to data structures which underpins two new forms of polymorphism. Path polymorphism supports searches or queries along all paths through an arbitrary data structure. Pattern polymorphism supports the dynamic creation and evaluation of patterns, so that queries can be customised in reaction to new information about the structures to be encountered. In combination, these features provide a natural account of tasks such as programming with XML paths. As the variables used in matching can now be eliminated by reduction it is necessary to separate them from the binding variables used to control scope. Then standard techniques suffice to ensure that reduction progresses and to establish confluence of reduction.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

First-class patterns

Pure pattern calculus supports pattern-matching functions in which patterns are first-class citizens that can be passed as parameters, evaluated and returned as results. This new expressive power supports two new forms of polymorphism. Path polymorphism allows recursive functions to traverse arbitrary data structures. Pattern polymorphism allows patterns to be treated as parameters which may be...

متن کامل

Barriers to Participation in Urban Plans from the Perspective of Citizens' Behavioral Patterns in Qazvin's Bolaghi Neighborhood

- Abstract Introduction: urban planning expected achievements in Iran, despite its long history, have not been satisfactory & they have not been able to materialize the welfare promised. even the most recent urban planning methods, often based on collaborative patterns, have not responded to the needs of citizens. Failure to implement these programs is affected by several factors. Lack of par...

متن کامل

Barriers to Participation in Urban Plans from the Perspective of Citizens' Behavioral Patterns in Qazvin's Bolaghi Neighborhood

- Abstract Introduction: urban planning expected achievements in Iran, despite its long history, have not been satisfactory & they have not been able to materialize the welfare promised. even the most recent urban planning methods, often based on collaborative patterns, have not responded to the needs of citizens. Failure to implement these programs is affected by several factors. Lack of par...

متن کامل

A Review of Relationship between Environmental Quality and Citizen’s Behavioral Patterns in Public Spaces (Case Study: Mashhad Kouhsangi and Qaranei Streets)

Purpose of this article is to introduce different approaches in reviewing the mutual relationship between the built environment and citizen’s behavioral patterns in public spaces with applying analytical and comparative methods by using a questionnaire, a sample of 200 members of the audience in two streets of Mashhad, Kouhsangi and Qaranei, by using two tests of the ordinal logistic regression...

متن کامل

Language Independent Traversals for Program Transformation

A Stratego program defines a transformation on first-order ground terms. Transformation rules define single transformation steps. Transformation rules are combined into transformation strategies by means of combinators that determine where and in what order rules are applied. These combinators include: primitives for traversal to the direct subterms of a node, allowing the definition of many ki...

متن کامل

PatBang Flexible type-safe pattern matching

Patterns provide an important dimension of expressiveness to functional programming languages because they describe a concise syntax for data destruction. However, most languages treat patterns as second-class citizens: case match expressions cannot be extended, patterns cannot be selected dynamically, and patterns cannot be composed or modified by program logic. In this paper, we present a ric...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2008